<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="toTop" content="true">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link rel="stylesheet" href="./Public/Home/css/xgdz.css"/>
<link rel="stylesheet" href="./Public/Home/css/dz.css"/>
<script src="./Public/Home/js/area.js" type="text/javascript"></script>
<!--头部公共部分调用-->
<script type="text/javascript" src="./Public/Home/js/jquery-1.8.2.min.js"></script>
<!--<script type="text/javascript" src="./Public/Home/js/jquery.1.7.2-min.js"></script>-->
<script type="text/javascript" src="./Public/Home/js/js.js"></script>

</head>
<body>
	
	<!-- 顶部开始 -->
<div id="top">
   <div class="topall">
       <a class="topallleft1" href="">商城首页</a>
       <a class="topallleft2" href="">玩货</a>
        
       <span class='topallleft3'>
       <a href="" class="login">13333333333</a>
       <a href="http://127.0.0.1/project/index.php?m=Home&c=Login&a=out" class="reg">退出</a>  
       </span>
       
                      <span class='link'>|</span>
       <span class='topallleft3'>
       <a href="http://127.0.0.1/project/index.php?m=Home&c=Orderlist&a=index" class="reg">我的订单</a>     
       </span>
       <span class='link'>|</span>
       <span class='topallleft3'>
       <a href="" class="reg">我的卖家</a>     
       </span>
       <span class='link'>|</span>
       <span class='topallleft3'>
       <a href="" class="reg">帮助中心</a>     
       </span>
       <span class='link'>|</span>
       <span class='topallleft4'>客服电话 400-810-0580</span>
   </div>	
</div>
<!-- 顶部结束 -->
<!-- 搜索区域开始 -->
<div id="search">
   <div class="searchleft">
   	  <a href=""class="searchlogo"></a>
   <div class="searchka">
  	 <form name="" action="" target="">
  	   <div class="searchkatext">
  	     <input name="" value="" type="text">
  	   </div>
  	   <div class="searchkasubmit">
  	     <input value="搜&nbsp;&nbsp;&nbsp;索" type="submit">
  	   </div>
  	   </form>
  	   <ul class="searchgjz">
	  	   <li><a href="">GoPro</a></li>
	  	   <li><a href="">大疆</a></li>
	  	   <li><a href="">PHILIPS电动牙刷</a></li>
	  	   <li><a href="">演唱会门票</a></li>
	  	   <li><a href="">20元海淘券</a></li>
  	   </ul>
  	   
   </div>
            <a href="http://127.0.0.1/project/index.php?m=Home&c=Cart&a=index&cmid=0" class="searchgwc"><i><em id='gwc' style="overflow: hidden;">2</em></i>购物车</a>
       
                  </div>
</div>
<!-- 搜索区域结束 -->

<!-- 导航分类开始 -->
<div id="nav">
	<div class="navall">
		<ul>
			<li><a href="index.php"  >首页</a></li>
						<li><a href="http://127.0.0.1/project/index.php?m=Home&c=Cata&a=index&cid=1" >影视周边</a></li>
						<li><a href="http://127.0.0.1/project/index.php?m=Home&c=Cata&a=index&cid=2" >数码IT</a></li>
						<li><a href="http://127.0.0.1/project/index.php?m=Home&c=Cata&a=index&cid=3" >图书用品</a></li>
						<li><a href="http://127.0.0.1/project/index.php?m=Home&c=Cata&a=index&cid=4" >个人美妆</a></li>
						<li><a href="http://127.0.0.1/project/index.php?m=Home&c=Cata&a=index&cid=5" >服饰配件</a></li>
						<li><a href="http://127.0.0.1/project/index.php?m=Home&c=Cata&a=index&cid=6" >小家电</a></li>
						<li><a href="http://127.0.0.1/project/index.php?m=Home&c=Cata&a=index&cid=7" >票务演出</a></li>
						<li><a href="http://127.0.0.1/project/index.php?m=Home&c=Cata&a=index&cid=8" >食品</a></li>
						<li><a href="http://127.0.0.1/project/index.php?m=Home&c=Cata&a=index&cid=9" >日用百货</a></li>
						<li><a href="http://127.0.0.1/project/index.php?m=Home&c=Cata&a=index&cid=10" >其他</a></li>
					</ul>
	</div>
</div>
<!-- 导航分类结束 -->


<!--内容区域开始-->
<div class="xgdz-1">
	<h1>填写并核对订单信息</h1>
</div>
<div class="xgdz-2">
	<h4>收货人信息</h4>
	<a href="javascript:;" class="addr1">添加新地址</a>
</div>
<?php foreach ($dzdata as $v){?>
<div class="xgdz-3">
	<dl>
		<dt>
		 <dd class="dd address"><a href="javascript:;"><?php echo $v['adname']?>&nbsp;&nbsp;&nbsp;<?php echo $v['region'][0]?></a></dd>
		 <dd class="dd dd-1 adname"><?php echo $v['adname']?></dd>
		 <dd class="dd dd-2 region">
		 	<span><?php echo $v['region'][0]?></span>
		 	<span><?php echo $v['region'][1]?></span>
		 	<span><?php echo $v['region'][2]?></span>
		 	<span><?php echo $v['adresse']?></span>
		 </dd>
		 <dd class="dd dd-1 phone"><?php echo $v['phone']?></dd>
		</dt>
	</dl>
</div>
<?php }?>
<div class="xgdz-2">
	<h4>支付信息</h4>
</div>
<div class="xgdz-3">
	<dl>
		<dt>
		 <dd class="dd"><a href="">在线支付</a></dd>
		</dt>
	</dl>
</div>
<div class="xgdz-2">
	<h4>确认订单信息</h4>
</div>
<?php foreach ($arr as $v){?>
<div class="psfs">
	<h6>配送方式：</h6>
</div>
<div class="xgdz-3 fg">
	<dl>
	   <dd class="dd"><a href="">快递配送 (免运费)</a></dd>
	   <dd class="dd-1">商家：<a href=""> 优酷店</a></dd>
	   <dd class="dt-10">
		   	<span class="span">单价（元）</span>
		    <span class="span span-1">数量</span>
		    <span class="span span-1">优惠</span>
		    <span class="span span-2">小计（元）</span>
	   </dd>
	   <dd class="dt-20">
	   	   <span class="span-10"><a href=""><img src="<?php echo $v['photo']?>"/></a></span>
	   	   <span class="span-11">
	   	   	<p><a href=""><?php echo $v['name']?></a></p><span style="color: #CCCCCC;">类型：</span>
	   	   	<?php foreach ($v['options'] as $vv){?>
	   	    <span style="padding-right: 10px; color: #CCCCCC;"><?php echo $vv?></span>
	   	    <?php }?> 
	   	   </span>
	   	   <span class="span"><?php echo $v['price']?></span>
		   <span class="span span-1 shuliang"><?php echo $v['num']?></span>
		   <span class="span span-1">0</span>
		   <span class="span allspan"><?php echo $v['total']?></span> 
       </dd>
	</dl>
</div>
<form action="<?php echo U('Order/add',array('sids'=>Q('get.sids')))?>" method="post">
<div class="xgdz-4">
	<h6>留言：</h6>
	<div><textarea name="oremarks[]" id="" ></textarea></div>
	<div class="all">
		<span>店铺合计：</span>
		<span class="all-1">￥<?php echo $v['total']?></span>
	</div>
</div>
<?php }?>

<div class="xgdz-2">
	<h4>开具发票</h4>
</div>
<div class="xgdz-10">
<input class="chk" value="1" type="checkbox">
	开具发票（普通发票 / <span class="title">
		个人</span> / <span class="content">明细</span>）
<a href="#" class="btn-link modify">修改</a>
</div>
<div class="xgdz-20">
	<div class="total">
		<dl><dt>商品数量：</dt>
			<dd><span class="count">0</span> 件</dd>
		</dl>
		<dl><dt>金额合计：</dt>
			<dd><span class="amount">0</span> 元</dd>
		</dl>
		<dl><dt>优惠：</dt>
			<dd><span class="youhui">0</span> 元</dd>
		</dl>
		<dl><dt>运费：</dt>
			<dd><span class="transcost">0</span> 元</dd>
		</dl>
	</div>
</div>
<div class="xgdz-30">
       应付总额：<span style="color: #EE4C23; font-size: 25px;">￥</span>	
       <em class="pay fn-rmb">0</em>
       <input type="hidden" name="oaddress" id="" value="" />
       <input type="hidden" name="oname" id="" value="" />
       <input type="hidden" name="sids" id="" value="<?php echo Q('get.sids')?>" />
       <button type="submit" class="btn btn-primary submit">提交订单</button>
</div>
</form>

<div class="delivery">
	<p class="addr">寄送至：
		<span class="jcdzzz"></span>
		
	</p>
	<p class="addressee">收件人：
		<span class="jcrmzz"></span>
	</p>
</div>
<!--内容区域结束-->
<div id='yingchang' style=" display: none; width: 100%;height: 100%; position:fixed;top: 0;left: 0; background: rgba(0,0,0,0.5);">
<div id="tankuang">
	<div class="top">
		<span class="span-1">新增收货地址</span>
		<span class="glyphicon glyphicon-remove" id="clos" style="cursor: pointer; font-size: 20px; float: right; " aria-hidden="true"></span>
	</div>
	<div class="content" style="padding-top: 30px;">
		<form class="form-horizontal" method="post" action="<?php echo U('Address/add',array('sids'=>Q('get.sids')))?>">
			<div class="form-group">
				<label for="input3" class="col-sm-2 control-label">*收获人：</label>
				<div class="col-sm-10">
					<input type="" class="form-control" id="input3" name="adname"  placeholder="收获人">
				</div>
			</div>
			<div class="form-group">
				<label for="input3" class="col-sm-2 control-label">身份证号：</label>
				<div class="col-sm-10">
					<input type="" class="form-control" id="input3" name="adnumber"  placeholder="身份证号">
				</div>
			</div><div class="form-group">
				<label for="input3" class="col-sm-2 control-label">所在地区：</label>
				<div class="col-sm-10">
					<!--<input type="" class="form-control" id="input3"  placeholder="所在地区">-->
						<select name="region[]" id="area1" class="area"></select>
	                    <select name="region[]" id="area2" class="area"></select>
	                    <select name="region[]" id="area3" class="area"></select>
				</div>
			</div><div class="form-group">
				<label for="input3" class="col-sm-2 control-label">*详细地址：</label>
				<div class="col-sm-10">
					<input type="" class="form-control" id="input3" name="adresse" placeholder="详细地址">
				</div> 
			</div><div class="form-group">
				<label for="input3" class="col-sm-2 control-label">*手机号吗：</label>
				<div class="col-sm-10">
					<input type="" class="form-control" id="input3" name="phone"  placeholder="手机号吗">
				</div>
			</div><div class="form-group">
				<label for="input3" class="col-sm-2 control-label">固定电话：</label>
				<div class="col-sm-10">
					<input type="" class="form-control" id="input3" name="telephone"  placeholder="固定电话">
				</div>
			</div><div class="form-group">
				<label for="input3" class="col-sm-2 control-label">邮政编码：</label>
				<div class="col-sm-10">
					<input type="" class="form-control" id="input3" name="zipcode"  placeholder="邮政编码">
				</div>
			</div>
			<div class="form-group" style="padding: 30px 445px;">
				<div class="col-sm-offset-2 col-sm-10">
					<button type="submit" class="btn btn-default">提交</button>
				</div>
			</div>
		</form>
	</div>
</div>
</div>
<script type="text/javascript">
$(function(){
		//点击显示添加新地址框
		$(".addr1").click(function(){
	       $("#yingchang").fadeIn();
	    });
	//  点击关闭添加框
		$("#clos").click(function(){
		    $("#yingchang").fadeOut();
		});
	//	城市异动选择
		$(function(){
			//初始化方法
			area.init('area');
			//修改的时候默认被选中效果
			area.selected('','','');
		})
		//获得总价格
		var a=0
		$.each($('.allspan'), function() {
//			设置浮点数或整数
			a+=parseFloat($(this).text());
		});
		
		//获得总数量
		var b=0;
		$.each($('.shuliang'), function() {
			//设置浮点数或整数
			b+=parseFloat($(this).text());
		});
		//分配到页面总价
		  $('.amount').text(a);
		  $('.pay').text(a);
		//分配到页面总数
		  $('.count').text(b);
		  
//		点击选择那个地址就付给购买地址
         $('.address').click(function(){
//       	抓取购买人
         	var adname=$(this).siblings('.adname').text();
//       	抓取地址

            var region=$(this).siblings('.region').text();
//       	
//       	抓取电话
         	var phone=$(this).siblings('.phone').text();
//       	选中地址加class样式
            $(this).addClass('dddd').parents('.xgdz-3').siblings('.xgdz-3').find('.address').removeClass('dddd');
//       	付给购买地址和收货人
         	$('.jcdzzz').text(region);
         	$('.jcrmzz').text(adname+"："+phone);
//       	给隐藏域赋值  地址和收货人
         	$('[name=oaddress]').val(region);
         	$('[name=oname]').val(adname);
        })
})

</script>
<!--调用尾部公用-->
<!--尾部区域开始-->
<div id="footer">
	<div class="footertop">
		<div class="footertop1"></div>
		<hr />
		<div class="footertop2">
			<p>
				商家入驻：
				<a href="http://www.tudou.com">mall@tudou.com</a>
			</p>
			
			
		</div>
		<div class="footertop2 top3">
			<p>
				Copyright©2015 优酷 youku.com 版权所有 京ICP证060288号 | 
				<a href="http://www.youku.com">优酷商城用户服务协议</a>
			</p>
	</div>	
</div>
<!--尾部区域结束-->
</body>
</html>
